<script setup>
import * as echarts from 'echarts';
import { onMounted,onBeforeUnmount } from 'vue'

const initDataVision=()=>{
  var chartDom = document.getElementById('storeFlow')
  var myChart = echarts.init(chartDom)
  var option

  option = {
    //       title: {
    //     text: '门店流量'
    //   },
    xAxis: {
      type: 'category',
      data: ['9:00', '12:00', '15:00', '18:00', '21:00', '23:59']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: [150, 230, 224, 218, 135, 147],
        type: 'line',
        smooth: true
      }
    ]
  }

  option && myChart.setOption(option)


}

onMounted(() => {

  initDataVision()

})
// onBeforeUnmount(() => {//防止echarts带来的空白bug
//     if (column) {
//         column.dispose()
//         column = undefined
//     }
//     if (line) {
//         line.dispose()
//         line = undefined
//     }
//     if (pie) {
//         pie.dispose()
//         pie = undefined
//     }
//     if (pies) {
//         pies.dispose()
//         pies = undefined
//     }
// })
</script>

<template>
  <div id="storeFlow" style="width: 600px;height:400px;"></div>
</template>



